TransactionSet

The set of transactions that are associated with a data file or RootAccount

Constructors

Link copied to clipboard
constructor(book: AccountBook)

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard

Add a new transaction to the transaction set. If this is a ParentTxn, all of it's associated SplitTxns are also added to the set.

Link copied to clipboard

Register an object that would like to receive notification when transactions have been modified, added, or removed.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

This is called after a data set has been fully loaded from a stream.

Link copied to clipboard
fun findBestMatch(payee: String?, amount: Long, acct: Account?): ParentTxn?

Find the most recent transaction that has the closest payee to the given value. If no transactions are a close enough match, return null. This currently only scans parent transactions.

Link copied to clipboard
fun getFirstMatch(separateSplitParents: Boolean, filter: TxnSearch): Txn?

Returns the first AbstractTxn that matches the given search. If separateSplitParents is true then this will iterate over fine-grained Txn objects, meaning that any ParentTxn with more than one split is returned in multiple Txn objects, one for the parent side of each SplitTxn.

Link copied to clipboard

Returns a list of Txn objects, which are the nodes that affect each account.

Link copied to clipboard

Puts all transactions matching the given filter into the provided collection. Returns the same collection, for your convenience.

Link copied to clipboard

Get all of the transactions that are in the specified account

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Puts all Txn objects matching the given filter into the provided collection. Txn objects represent one side of a double-entry transaction in a cleaner way than the current asymmetric ParentTxn ->> SplitTxn relationship. With Txn objects, a multi-split transaction is treated as multiple Txn object pairs, where each Txn object has one account/category and one amount which is the reverse amount of its matching Txn. txn1A(accountA, amt1) -> txn1B(account1, -amt1) txn2A(accountA, amt2) -> txn2B(account2, -amt2) txn3A(accountA, amt2) -> txn3B(account3, -amt3) txn4(accountA, amt2) -> fTxn4(account4, -amt4)

Link copied to clipboard

Get all of the transactions that are in the specified account

Link copied to clipboard
Link copied to clipboard

Return a reference to an iterable list of transactions. Please note that anything calling this should synchronize on this TransactionSet while the iteration is in progress to avoid concurrency exceptions

Link copied to clipboard
open operator override fun iterator(): MutableIterator<AbstractTxn>

Return an Enumeration containing all of the transactions. Callers should synchronize on this TransactionSet while iterating to avoid ConcurrentModificationExceptions when the background syncing changes the set of transactions.

Link copied to clipboard

Add the specified transaction to the txn set. This should only be called when loading transactions into the set from a file or database. This should NOT be called by normal code to add a transaction.

Link copied to clipboard
fun matchPayee(account: Account?, description: String, caseSensitive: Boolean, numMatches: Int): Array<ParentTxn>?

Return the most recently entered 'numMatches' transactions that match the given description. If the caseSensitive flag is true then the matching transactions must start with the exact string in description.

Link copied to clipboard
fun matchSplitPayee(account: Account?, description: String, caseSensitive: Boolean, numMatches: Int): Array<SplitTxn?>?

Return the most recently entered 'numMatches' split transactions that match the given description. If the caseSensitive flag is true then the matching transactions must start with the exact string in description.

Link copied to clipboard

Add a new transaction to the transaction set without logging it.

Link copied to clipboard
fun removeAll()

Good gravy, don't call this. Are you MAD???

Link copied to clipboard

Remove the specified transaction. This is new as of build 600. Before build 600 this only accepted a ParentTxn

Link copied to clipboard
Link copied to clipboard
fun setDirty()
Link copied to clipboard

Record that the specified transaction has been modified, notifying all listeners that this txn and all of its splits have been modified.

Link copied to clipboard
Link copied to clipboard
fun txnWasUpdated(t: ParentTxn, isAllNew: Boolean)